home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d21
/
dvglue.arc
/
TVKREAD.C
< prev
next >
Wrap
C/C++ Source or Header
|
1990-01-09
|
1KB
|
37 lines
/*================================================*/
/* TVKREAD.C */
/* */
/* (c) Copyright 1988 Ralf Brown */
/* All Rights Reserved */
/* May be freely copied for noncommercial use, */
/* provided that this copyright notice remains */
/* intact and any changes are indicated in the */
/* comment blocks preceding functions */
/*================================================*/
#include "tvapi.h"
/*================================================*/
/* TVkbd_read get input from keyboard */
/* Ralf Brown 4/22/88 */
/*================================================*/
int pascal TVkbd_read(OBJECT kbd,char *buffer,int maxsize)
{
PARMLIST2 p ;
int count ;
p.num_args = 0 ;
TVsendmsg(READ_MSG, kbd?TOS:KEYME, kbd, (PARMLIST *)&p) ;
count = (int) p.arg[1] ;
maxsize-- ; /* reserve space for the null to terminate the string */
if (count > maxsize)
count = maxsize ;
while (count-- > 0)
*buffer++ = *((char far *)p.arg[0])++ ;
*buffer = '\0' ;
return (int) p.arg[1] ;
}
/* End of TVKREAD.C */